package com.tourism.website.articlepersonal.mapper;

import com.tourism.website.articlepersonal.entity.ArticleCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author kevin
 * @since 2024-06-13
 */
@Mapper
public interface ArticleCategoryMapper extends BaseMapper<ArticleCategory> {
    @Insert("INSERT INTO article_category (article_id,category_id) VALUES (#{articleId},#{categoryId})")
    int insertCategory(int articleId,int categoryId);

    @Select("SELECT category_pid from category WHERE category_id = #{categoryId}")
    int queryCategoryPid(Integer categoryId);

}
